package com.data.hijack.service;

import java.nio.channels.SelectionKey;
import java.util.Objects;

/**
 * @author husq
 */
public class Dispatcher {
    public static void dispatch(SelectionKey selectionKey) {
        Handler h = (Handler)selectionKey.attachment();
        if (Objects.nonNull(h)) {
            Object o = h.handle();
            if (Objects.nonNull(o)) {
                ((Handler)o).handle();
            }
        }
    }
}
